﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebStudio.Business.Rule;

public partial class NewsList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            loadData();
        }
    }

    private void loadData()
    {
        anpList.PageSize = 20;
        anpList.CurrentPageIndex = 1;
        anpList.RecordCount = ArticalRule.GetArticalListCount(1, 1, 0);
        rptNewsBind();
    }

    private void rptNewsBind()
    {
        rptNews.DataSource = ArticalRule.GetArticalList(anpList.CurrentPageIndex, anpList.PageSize,anpList.PageCount,anpList.RecordCount, 1, 1, 0);
        rptNews.DataBind();
    }

    protected void anpList_PageChanged(object sender, EventArgs e)
    {
        rptNewsBind();
    }
}
